package command.grupo;

import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;

import model.Grupo;

import command.ICommand;
import dao.GrupoDAO;

public class TransportaGrupoCommand implements ICommand{

	@Override
	public String execute(HttpServletRequest request) throws ServletException,IOException {
		GrupoDAO dao = new GrupoDAO();
		ArrayList<Grupo> grupos;
		try {
			grupos = dao.listar();
			request.setAttribute("grupo",grupos);
			return "/paginas/respondente/inserir_respondente.jsp";
		} catch (SQLException e) {
			e.printStackTrace();
			return "#";
		}
	}

}
